//
//  MusicTableViewCell.m
//  项目
//
//  Created by 张诗雨 on 14/12/30.
//  Copyright (c) 2014年 张诗雨. All rights reserved.
//

#import "MusicTableViewCell.h"
#import "WebColor.h"
@implementation MusicTableViewCell
- (void)dealloc
{
    [super dealloc];
    [_backImg release];
    [_imgView release];
    [_titleLable release];
    [_contentLable release];
    [_typeLable release];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [WebColor whiteSmoke];
        self.typeLable = [[UILabel alloc] initWithFrame:CGRectMake(20, 0, 100, 20)];
        self.typeLable.textColor = [WebColor steelBlue];
        self.typeLable.font = [UIFont systemFontOfSize:15.0f];
        [self.contentView addSubview:self.typeLable];
        [_typeLable release];

        
        self.backImg = [[UIImageView alloc] init];
        self.backImg.image = [UIImage imageNamed:@"bg_share_large.png"];
        [self.contentView addSubview:self.backImg];
        [_backImg release];
        
        self.imgView = [[UIImageView alloc] init];
        self.imgView.image = [UIImage imageNamed:@"cell_play.png"];
        [self.backImg addSubview:self.imgView];
        [self.imgView release];
        
        self.titleLable = [[UILabel alloc] init];
        self.titleLable.textAlignment = NSTextAlignmentLeft;
        self.titleLable.font = [UIFont boldSystemFontOfSize:17.0f];
        [self.backImg addSubview:self.titleLable];
        [self.titleLable release];
        
        self.contentLable = [[UILabel alloc] init];
        self.contentLable.textColor = [WebColor silver];
        self.contentLable.font = [UIFont systemFontOfSize:15.0f];
        self.contentLable.numberOfLines = 0;
        [self.backImg addSubview:self.contentLable];
        [_contentLable release];
        
        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.backImg.frame = CGRectMake(10, 25, self.frame.size.width - 20, self.frame.size.height - 35);
    self.titleLable.frame = CGRectMake(5, 5, self.backImg.frame.size.width * 2/ 3, self.backImg.frame.size.height / 4);
    self.contentLable.frame = CGRectMake(5, self.backImg.frame.size.height / 4 + 5, self.backImg.frame.size.width * 2/ 3, self.backImg.frame.size.height * 3 / 4);
    self.imgView.frame = CGRectMake(self.backImg.frame.size.width - 70, self.backImg.frame.size.height / 2 - 20, 40, 40);
}
@end
